#!/usr/bin/python

while True:
    s = raw_input('Enter something (enter "quit" to quit): ')
    if s == 'quit':
        break
    print 'Length of the string is', len(s)
else:# In this case, the 'else:' for while and for is not unnecessary
    print 'The while loop is over'
    # if break, this block will not to be executed.
print 'Done'


number = 23
for i in range(1, 6):
    guess = int(raw_input('Enter a integer : '))

    if guess == number:
        print 'Congratulations, you guessed it'
        break
    else:
        HL = ''
        if guess < number:
            HL = 'higher'
        else:
            HL = 'lower'
        print 'No, it is a little',HL,'than that'
        print 'leave', 6 - i - 1,'chance'
else:
    print 'Sorry, you have no chance'# In this case, the 'else:' for while and for is not unnecessary

